import static org.junit.Assert.*;

import javax.swing.ImageIcon;
import javax.swing.JSlider;

import org.junit.Test;



public class MapPanelTest {

	private ImageIcon image = new ImageIcon("canada.jpg");
	private MapPanel panel = new MapPanel(new JSlider());
	private Map canadaMap = new Map(image.getImage(), panel);
	
	@Test
	public void testJUnit()
	{
		assertTrue("No no no Minge", true);
	}
	
	@Test
	public void testMapPanel()
	{
		assertNotNull(new MapPanel(new JSlider()));
	}
	
	@Test
	public void testMapPanelNoMapsGetMap()
	{
		assertNull(panel.getMap());
	}
	
	@Test
	public void testMapPanelMapGetMap()
	{
		panel.addMapToPanel(image.getImage());
		assertNotNull(panel.getMap());
	}
	
	@Test
	public void testMapPanelSetDisplayMap()
	{
		panel.setDisplayMap(canadaMap);
		assertNotNull(panel.getMap());
	}
	
	@Test
	public void testMapPanelDeleteMap()
	{
		panel.setDisplayMap(canadaMap);
		panel.deleteCurrentMap();
		assertNull(panel.getMap());
	}
	
	@Test
	public void testMapPanelNoMapsGetMapList()
	{
		assertTrue(new MapPanel(new JSlider()).getMapList().isEmpty());
	}
	
	@Test
	public void testMapPanelMapsGetMapListExists()
	{
		panel.addMapToPanel(image.getImage());
		assertFalse(panel.getMapList().isEmpty());
	}
	
	@Test
	public void testMapPanelGetMapListMapEq()
	{
		panel.addMapToPanel(image.getImage());
		assertEquals(panel.getMapList().get(0).getMapImage().getImage(), canadaMap.getMapImage().getImage());
	}
	
	@Test
	public void testMapPanelSetMapList()
	{
		panel.addMapToPanel(image.getImage());
		MapPanel herpDerp = new MapPanel(new JSlider());
		panel.setMapList(herpDerp.getMapList());
		assertTrue(panel.getMapList().isEmpty());
	}
}
